<script setup lang="ts">
import CisTree from "@/packages/library/CisTree/index";

let data = ref([] as any);

setTimeout(()=>{
  data.value=[
    {
      Id: 1,
      label: 'Level one 1',
      children: [
        {
          Id: 2,
          label: 'Level two 1-1',
          children: [
            {
              Id: 3,
              label: 'Level three 1-1-1',
            },
          ],
        },
      ],
    },
    {
      Id: 4,
      label: 'Level one 2',
      children: [
        {
          Id: 5,
          label: 'Level two 2-1',
          children: [
            {
              Id: 6,
              label: 'Level three 2-1-1',
            },
          ],
        },
        {
          Id: 7,
          label: 'Level two 2-2',
          children: [
            {
              Id: 8,
              label: 'Level three 2-2-1',
            },
          ],
        },
      ],
    },
    {
      Id: 9,
      label: 'Level one 3',
      children: [
        {
          Id: 10,
          label: 'Level two 3-1',
          children: [
            {
              Id: 11,
              label: 'Level three 3-1-1',
            },
          ],
        },
        {
          Id: 12,
          label: 'Level two 3-2',
          children: [
            {
              Id: 13,
              label: 'Level three 3-2-1',
            },
          ],
        },
      ],
    },
  ];
},1000)
const currentChange = (node: any) => {
  console.log(node);
}

</script>

<template>
  <CisTree
      :data="data"
      defaultByChild
      @current-change="currentChange"
  ></CisTree>
</template>

<style scoped lang="scss">

</style>